﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Icon_EquipmentSetting : MonoBehaviour
{
    private int star = 5;
    public int Star
    {
        get
        {
            return star;
        }
        set
        {
            star = value;
            if (star<1)
            {
                star = 1;
            }else if(star > 5)
            {
                star = 5;
            }

            transform.GetChild(4).GetComponent<BlueStarSetting>().SetCount(value);
        }
    }

    public int Count
    {
        get
        {
            return int.Parse(transform.GetChild(3).GetComponent<Text>().text);
        }
        set
        {
            transform.GetChild(3).GetComponent<Text>().text = value.ToString();
        }
    }

    public Sprite Box
    {
        get
        {
            return transform.GetChild(1).GetComponent<Image>().sprite;
        }
        set
        {
            transform.GetChild(1).GetComponent<Image>().sprite = value;
        }
    }
    public Sprite Equipment
    {
        get
        {
            return transform.GetChild(0).GetComponent<Image>().sprite;
        }
        set
        {
            transform.GetChild(0).GetComponent<Image>().sprite = value;
        }
    }
    public Sprite TypeSprite
    {
        get
        {
            return transform.GetChild(2).GetComponent<Image>().sprite;
        }
        set
        {
            transform.GetChild(2).GetComponent<Image>().sprite = value;
        }
    }
}
